<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:ui="http://java.sun.com/jsf/facelets">
    <h:head>
        <link rel="shortcut icon" href="images/favicon.ico"/>
        <title>JForum :: #{resourcesController.extractResource('MAKE_NEW_THREAD')}</title>
    </h:head>
    <h:body style="background-color: #111111">
      <div id="header">
		<ui:insert name="header" >
			<ui:include src="header.xhtml" />
		</ui:insert>
      </div>
        <center>
          <h:form>  
              <p:growl id="messageGrowl" showDetail="true"/>
              <p:panel header="#{resourcesController.extractResource('MAKE_NEW_THREAD')}" 
                       style="width:790px" 
                       footer="#{resourcesController.extractResource('MAKE_NEW_THREAD')}">
                  <h:panelGrid>
                        #{resourcesController.extractResource('ENTER_THREAD_NAME')}
                        <p:inputText value="#{newThreadBean.title}"
                                     size="50"
                                     maxlength="100"
                                     id="title"
                                     required="true"
                                     requiredMessage="#{resourcesController.extractResource('NO_THREAD_NAME')}"/>
                        #{resourcesController.extractResource('ENTER_DESCR')}
                        <p:inputTextarea value="#{newThreadBean.text}"
                                         id="text"
                                         cols="51" 
                                         rows="10"
                                         required="true"
                                         requiredMessage="#{resourcesController.extractResource('NO_DESCR')}"/>
                        <p:commandButton action="#{newThreadBean.createThread(authorizationBean.user.username)}"
                                         update="messageGrowl"
                                         value="#{resourcesController.extractResource('ADD_THREAD')}" />
                 </h:panelGrid>
            </p:panel>
          </h:form>
        </center>
        <ui:insert name="header" >
			<ui:include src="footer.xhtml" />
        </ui:insert>
    </h:body>
</html>

